package org.sl.flvplayer.flyweights {

	/**
	 * FlyweightPlayerCommand provides commands with optional parameters to an instance which inicialized it. 
	 * 
	 * @package org.sl.flvplayer.flyweights
	 * @author Dan
	 * @version 
	 * @see org.sl.flvplayer.controls.PlayerLogic
	 * @see org.sl.flvplayer.controls.JavascriptController
	 * @see org.sl.flvplayer.data.Playlist
	 * @see org.sl.flvplayer.data.VideoItem
	 * @see org.sl.flvplayer.elements.SeekControllerElement
	 * @see org.sl.flvplayer.elements.VolumeControllerElement
	 */ 
	public class FWPlayerCommand {

		/**
		 * defines and loads the video
		 */
		public static const SOURCE : String = "Player.Source";

		/**
		 * starts playback
		 */
		public static const PLAY : String = "Player.Start";

		/**
		 * toggles play pause state
		 */
		public static const PAUSE : String = "Player.Pause";

		/**
		 * stops the plaback and sets the video at its beginning
		 */
		public static const STOP : String = "Player.Stop";

		/**
		 * toggles the mute state of the sound
		 */
		public static const MUTE : String = "Player.Audio.Mute";

		/**
		 * sets the volume of the sound
		 */
		public static const VOLUME : String = "Player.Audio.Volume";

		/**
		 * displays the video
		 */
		public static const RENDER : String = "Player.Display.Render";

		/**
		 * toggles between fullscreen and normal view
		 */
		public static const FULLSCREEN : String = "Player.Display.FullScreen";

		/**
		 * seeks to the desired postion in the video
		 */
		public static const SEEK : String = "Player.Seek";

		/**
		 * shows the GUI of the playerapplication
		 */
		public static const SHOWCONTROLS : String = "Player.Controls.ShowGUI";

		/**
		 * hides the GUI of the playerapplication
		 */
		public static const HIDECONTROLS : String = "Player.Controls.HideGUI";

		/**
		 * instance of the class which initialized the flyweight
		 */
		public var callbackInstance : *;

		/**
		 * desired command
		 */
		public var command : String;

		/**
		 * parameters stored in an array
		 */
		public var params : Array;

		/**
		 * P_callbackInstance and p_params are optional parameters.
		 * 
		 * @param p_callbackInstance instance of the class which initialised the flyweight
		 * @param p_command command
		 * @param p_params Additional parameteres necessary to execute the command
		 */
		public function FWPlayerCommand(p_command : String = "" ,p_callbackInstance : * = null, p_params : Array = null) {
			command = p_command;
			callbackInstance = p_callbackInstance;
			params = p_params;
		}
	}
}
